<div class="masters index">
	<h2><?php __('Masters');?></h2>
		<div style="float:right;">
                    <?php echo $html->image('1.png', array( 'width' => '100', 'heigth' => '90', 'alt' =>'Nueva Busqueda', 'title' => 'Nueva Busquda', 'url' => array('controller'=>'searches','action' => 'nueva_busqueda')));?>
</div>
	<table cellpadding="0" cellspacing="0">
	<tr>
			<th><?php echo $this->Paginator->sort('DNFDA','id');?></th>
			<th><?php echo $this->Paginator->sort('fecha');?></th>
                        <th><?php echo $this->Paginator->sort('vehicles_id');?></th>
                        <th><?php echo $this->Paginator->sort('causes_id');?></th>
                        <?php if($session->read('perfil')=='0'){ ?>
                        <th><?php echo $this->Paginator->sort('Estado Renavese','states_id');?></th>  
                        <?php }?>
                        <th><?php echo $this->Paginator->sort('Estado','police_states_id');?></th>               
                        <th><?php echo $this->Paginator->sort('Deposito','desposits_id');?></th>
<!--			<th><?php //echo $this->Paginator->sort('requests_id');?></th>-->
			
			
<!--			<th><?php //echo $this->Paginator->sort('caja_archivo');?></th>
			<th><?php //echo $this->Paginator->sort('pericia');?></th>
			<th><?php //echo $this->Paginator->sort('foto');?></th>
			<th><?php //echo $this->Paginator->sort('rodamiento');?></th>-->
			<th><?php echo 'Observaciones';?></th>
			<th class="actions"><?php __('Actions');?></th>
	</tr>
	<?php
	$i = 0;
	foreach ($masters as $master):
		$class = null;
		if ($i++ % 2 == 0) {
			$class = ' class="altrow"';
		}
	?>
	<tr<?php echo $class;?>>
		<td><?php echo $master['Master']['id']; ?>&nbsp;</td>
                <td><?php echo $time->format('j-m-Y',$master['Master']['fecha']); ?>&nbsp;</td>
                <td>
			<?php
                        if($session->read('perfil')=='0'){
                        echo $this->Html->link($master['Vehicles']['dominio'], array('controller' => 'vehicles', 'action' => 'view', $master['Vehicles']['id'])); 
                        }else{echo $master['Vehicles']['dominio'];}?>
		</td>
                <td>
			<?php 
                        if($session->read('perfil')=='0'){
                        echo $this->Html->link($master['Causes']['nro_causa'], array('controller' => 'causes', 'action' => 'view', $master['Causes']['id']));
                        }else{ echo $master['Causes']['nro_causa'];}?>
		</td>
                 <?php if($session->read('perfil')=='0'){ ?>
		<td>
			<?php echo $states[$master['Master']['states_id']]; ?>
		</td>
                <?php } ?>
               <td>
			<?php echo $policestates[$master['Master']['police_states_id']]; ?>
		</td>
		<td>
			<?php echo $deposits[$master['Master']['desposits_id']]; ?>
		</td>

<!--		<td>
			<?php //echo $this->Html->link($master['Requests']['id'], array('controller' => 'requests', 'action' => 'view', $master['Requests']['id'])); ?>
		</td>-->
		
		
<!--		<td><?php //echo $master['Master']['caja_archivo']; ?>&nbsp;</td>
		<td><?php //echo ($master['Master']['pericia'] == 0) ? 'No' : 'Si'; ?>&nbsp;</td>
		<td><?php //echo ($master['Master']['foto'] == 0) ? 'No' : 'Si';; ?>&nbsp;</td>
		<td><?php //echo ($master['Master']['rodamiento'] == 0) ? 'No' : 'Si';; ?>&nbsp;</td>-->
		<td><?php echo $master['Master']['observaciones']; ?>&nbsp;</td>
		<td class="actions">
			<?php //echo $this->Html->link(__('View', true), array('controller'=>'masters','action' => 'view', $master['Master']['id'])); ?>
	                <?php if($session->read('perfil')=='0'){?> 
			<?php echo $html->image('edit.png', array( 'width' => '13', 'heigth' => '13', 'alt' =>'Editar', 'title' => 'Editar', 'url' => array('controller'=>'masters','action' => 'edit', $master['Master']['id']) ));?>
			<?php echo $html->image('librito.png', array( 'width' => '13', 'heigth' => '13', 'alt' =>'Legajo', 'title' => 'Legajo', 'url' => array('controller'=>'masters','action' => 'legajo', $master['Master']['id'])));?>
			<?php }?>
                        <?php echo $html->image('search.png', array( 'width' => '13', 'heigth' => '13', 'alt' =>'Ver', 'title' => 'Ver', 'url' => array('controller'=>'masters','action' => 'view', $master['Master']['id'])));?>
		</td>
	</tr>
<?php endforeach; ?>
	</table>
	<p>
	<?php
	echo $this->Paginator->counter(array(
	'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
	));
	?>	</p>

	<div class="paging">
		<?php echo $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class'=>'disabled'));?>
	 | 	<?php echo $this->Paginator->numbers();?>
 |
		<?php echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?>
	</div>
</div>
